Using the Full-Text Indexing Wizard to Build Full-Text Indexes and Catalogs
Although
the T-SQL full-text commands provide a scriptable interface for
creating full-text catalogs and indexes, sometimes it is easier to use
the Full-Text Indexing Wizard to create them. To create a full-text
index, follow these steps:
1. | Connect to SQL Server in SQL Server Management Studio.
|
2. | Expand the databases folder.
|
3. | Expand the database that contains the tables you want to full-text index.
|
4. | Expand the tables folder.
|
5. | Right-click the table you want to full-text index (in this example, the Production.Document table).
|
6. | Select Full-Text Index, as shown in Figure 1.
|
You then click Define
Full-Text Index to launch the Full-Text Indexing Wizard. On the Welcome
to the SQL Server Full-Text Indexing Wizard splash screen, you click
Next to bring up the Select an Index dialog, as shown in Figure 2.
In the Unique Index drop-down box, you select the unique index you want
to use for the full-text index. In this example, the only option is the
primary key, PK_Document_DocumentID.
Tip
If there are multiple
unique keys to choose from, it is recommended that you choose the
smallest of the unique keys. It is also a good idea to choose a unique
key; this is a static column that is unlikely to be modified.
You may get the message “A
unique column must be defined on this table/view.” In this case, you
have to create a unique index or primary key on the table before you can
proceed. If a unique index or primary key exists, the Next button is
enabled. When you click the Next button, the next dialog you see is the
Select Table Columns dialog (see Figure 3).
In this dialog, you select the columns you want to index and the word
breaker you want to use to index the contents of this column.
Notice that the Select Table Columns dialog displays only the columns that can be full-text indexed. In this example, the FileName and DocumentSummary columns will be indexed by the server default full-text language. For the Document
column, you select the language (English) by clicking the drop-down box
that displays the available languages. The document type (in this case FileExtension)
also needs to be selected. You then click Next and proceed to choose
the population type from the Select Change Tracking dialog (see Figure 4).
There are three options
in the Select Change Tracking dialog: Automatically (continuous change
tracking), Manually (change tracking with scheduled or manual updates),
and Do Not Track Changes. If you specify Do Not Track Changes, the Start
Full Population When Index Is Created check box is enabled. You click
Next to advance to the Select a Catalog dialog. This dialog allows you
to select an existing catalog or create a new catalog with options to
set the catalog accent sensitivity and to make it the default catalog.
You click Next to set incremental table and catalog populations. You
click Next to view the summary page and finish creating your full-text
indexes and catalogs. You click Close to complete the
wizard. If you are running Service Pack 1, you need to right-click your
table one more time, select Full-Text Index, and select Enable
Full-Text Index to start change tracking.
You are now ready to start querying your full-text indexes.